use std::io::Read;

use alex_album::{bootstrap, entities};
use sea_orm::EntityTrait;

#[tokio::main]
async fn main() -> anyhow::Result<()> {
    let db = bootstrap::db_init().await?;
    let mut fp = std::fs::File::open("./examples/id")?;
    let mut id = String::new();
    let _ = fp.read_to_string(&mut id);
    let res = entities::album::Entity::delete(entities::album::ActiveModel {
        id: sea_orm::ActiveValue::Set(id),
        ..Default::default()
    })
    .exec(&db)
    .await?;
    println!("{:#?}", res);

    Ok(())
}
